<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <title>YT微博客户端</title>
        <script type="text/javascript" src="app:/lib/air/AIRAliases.js"></script>
		<script type="text/javascript" src="app:/lib/air/AIRIntrospector.js"></script>
        <script type="text/javascript"> 
		/**
		 * 创建阴影滤镜
		 * @param {Object} x
		 * @param {Object} y
		 */
			var createShadowFilter = function(x,y){
				var _sf = new runtime.flash.filters.DropShadowFilter(0,0);
				_sf.blurX = x || 10;
				_sf.blurY = y || 10;
				return _sf;
			}		   
			window.onload = function(){
				//局中窗体
				nativeWindow.x = (air.Capabilities.screenResolutionX - nativeWindow.width)/2;
				nativeWindow.y = (air.Capabilities.screenResolutionY - nativeWindow.height)/2;				
				var loader = new air.HTMLLoader();
				//主页面偏移
				loader.x = 10;
				loader.y = 10;
				//取消html的默认背景
				loader.paintsDefaultBackground = false;
				//应用滤镜
				loader.filters = [createShadowFilter()];
				//监听加载完成事件
				loader.addEventListener(air.Event.COMPLETE,function(event){
					var loader = event.target;
					//修正html页面的宽高
					loader.width = nativeWindow.width-10;
					loader.height = loader.window.document.height;
					//将主窗体对象传入子html页面
					loader.window.nativeWindow = nativeWindow;					
				})
				//读取主页面
				loader.load(new air.URLRequest("main.html"));
				//将html页面添加到舞台
				htmlLoader.stage.addChild(loader);
			}
						
        </script>
	</head>

    <body>

    </body>
</html>